/* custom_navigation.css */
.custom-apple-nav {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    padding: 15px;
    background-color: var(--bg-color, #f7f7f7);
    border-radius: 12px;
    
    display: flex;
    flex-wrap: wrap;
    gap: 25px; 
}

.nav-section {
    border: 1px solid var(--border-color, #e0e0e0);
    /* Reduced padding (approx 20% less vertical padding than 32px) */
    padding: 26px 20px; 
    border-radius: 10px; 
    background-color: var(--card-bg, #ffffff);
    box-shadow: 0 3px 7px rgba(0,0,0,0.06); 

    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 100%; 
    box-sizing: border-box;
    margin-bottom: 0;
    overflow: hidden; 
}

.nav-section-title {
    font-size: 1.2em; 
    font-weight: 600;
    color: var(--text-color, #333);
    /* Reduced margin (approx 20% less than 25px) */
    margin-bottom: 20px; 
    /* Reduced padding (approx 20% less than 12px) */
    padding-bottom: 10px; 
    border-bottom: 1px solid var(--border-color-light, #eaeaea);
    word-break: break-word; 
}

.nav-icons-grid {
    display: flex;
    flex-wrap: nowrap; 
    gap: 8px; 
    justify-content: flex-start; 
}

.nav-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color, #333);
    padding: 4px; 
    border-radius: 8px; 
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    text-align: center;
    box-sizing: border-box;

    flex-basis: calc((100% - 24px) / 4);
    flex-shrink: 1; 
    flex-grow: 0;
    min-width: 0; 
}

.nav-icon-item:hover {
    background-color: var(--control-bg, #e9ecef);
    transform: translateY(-2px); 
}

.nav-icon-item:active .nav-icon-visual {
    transform: scale(0.92); 
}
.nav-icon-item:active .nav-icon-label {
    opacity: 0.8;
}

/* Mobile icon visual styling */
.nav-icon-visual {
    width: 80%; 
    padding-top: 80%; 
    height: 0; 
    position: relative; 
    
    margin: 0 auto 6px auto; 
    border-radius: 20%; 
    box-shadow: 0 1px 4px rgba(0,0,0,0.08); 
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-icon-visual svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20%; 
    box-sizing: border-box; 
    fill: white; 
}

.nav-icon-visual[style*="background-color: #FFEB3B"] svg {
    fill: #333333; 
}

.nav-icon-label {
    /* Increased font size to approx 15px (15/16 = 0.9375em) */
    font-size: 0.9375em; 
    color: var(--text-muted, #555);
    line-height: 1.3; 
    width: 100%; 
    white-space: normal; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-height: 2.6em; /* Approx 2 lines (0.9375em * 1.3 * 2 lines = 2.4375em) - adjust if needed */
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
}

/* --- Desktop and Tablet Adjustments (screens >= 768px) --- */
@media (min-width: 768px) {
    .nav-section {
        flex-basis: calc((100% - 25px) / 2); 
        max-width: calc((100% - 25px) / 2);
        /* Reduced desktop padding (approx 20% less vertical padding than 40px) */
        padding: 32px 25px; 
    }

    .nav-icons-grid {
        gap: 12px; 
    }

    .nav-icon-item {
        flex-basis: calc((100% - 36px) / 4);
        padding: 8px; 
    }

    .nav-icon-visual {
        width: 54px;  
        height: 54px; 
        padding-top: 0; 
        border-radius: 16px; 
        margin: 0 auto 10px auto; 
    }

    .nav-icon-visual svg {
        padding: 12px; 
    }

    .nav-icon-label { 
        /* font-size: 0.9375em; -- This is now the base size */
        white-space: nowrap; 
        max-height: none; 
        display: block; 
    }
}